﻿using DevZest.Windows.Docking;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Markup;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Xml;
using System.Xml.Serialization;

namespace neside2
{
    //可以用继承的方式改变他Save的内容
    //安全方式 就 return 一个 string 之类的恢复
    //快捷方式就 return this
    public class DockItemMy : DockItem
    {
        public string pluginName;//内容ID，需要据此恢复视图
        public string panelType;
        protected override object Save()
        {
            return new string[] { "DockInfo", pluginName, panelType };
        }
    }
    public class DockItemFile : DockItem
    {
        public string pluginName;//内容ID，需要据此恢复视图
        public string extName;
        public string filename;
        public bool writeable;
        protected override object Save()
        {
            return new string[] { "DocDockInfo", pluginName, extName, filename, writeable.ToString() };
        }
    }
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            //这个控件有一点bug，显示Item之前一定要保证dockcontrol已经显示
            //window loaded 太早了，在dockcontrol . loaded 后可以正常使用了

        }
        private void Dockpanel_Loaded(object sender, RoutedEventArgs e)
        {
            IDEManager mgr = new IDEManager(this.dockpanel, this.menu, this.toolbartray);
            mgr.RegPlugin(new Plugin_Default());//默认插件
            mgr.RegPlugin(new wpf_nes.Plugin());
            mgr.RegPlugin(new wpf_buildtool.Plugin());
            mgr.Start();
        }

    }
}
